//
//  XLChatInputToolBarUser.h
//  XiangLove
//
//  Created by 李传坤 on 2018/4/18.
//  Copyright © 2018年 BAOMIHUA.COM. All rights reserved.
//

#import <UIKit/UIKit.h>


@class XLChatInputToolBarUser;
@protocol XLChatInputToolBarUserDelegate <NSObject>
- (void)onToolBarClickAudio:(XLChatInputToolBarUser *)bar show:(BOOL)isShow;
- (void)onToolBarClickEmoj:(XLChatInputToolBarUser *)bar show:(BOOL)isShow;
- (void)onToolBarClickPhoto:(XLChatInputToolBarUser *)bar show:(BOOL)isShow;
- (void)onToolBarClickVideo:(XLChatInputToolBarUser *)bar show:(BOOL)isShow;
- (void)onToolBarClickPhoneChat:(XLChatInputToolBarUser *)bar show:(BOOL)isShow;




- (void)onToolBarClickMore:(XLChatInputToolBarUser *)bar show:(BOOL)isShow;
- (void)onToolBarClickPayimage:(XLChatInputToolBarUser *)bar show:(BOOL)isShow;
- (void)onToolBarClickFreeimage:(XLChatInputToolBarUser *)bar show:(BOOL)isShow;
- (void)onToolBarClickPayVideo:(XLChatInputToolBarUser *)bar show:(BOOL)isShow;
- (void)onToolBarClickChatVideo:(XLChatInputToolBarUser *)bar show:(BOOL)isShow;
- (void)onToolBarClickFlower:(XLChatInputToolBarUser *)bar show:(BOOL)isShow;

@end


@interface XLChatInputToolBarUser : ChatInputBaseView<UITextViewDelegate, MyEmojBoardDelegate, ChatSystemFaceInputDelegate>
{
@protected
    UIButton                *_audio; //录音按钮
    UIButton                *_emoj; //表情按钮
    UIButton                *_photo; //照片按钮
    UIButton                *_video; //视频按钮
    UIButton                *_phoneChat; //电话聊天按钮
@protected
    UIButton                *_audioPressed;
    UITextView              *_textView;
    
//@protected
//    UIButton                *_emoj;
    
@protected
    UIButton                *_more;
    UIButton                *_payImageBtn;
    UIButton                *_moneyVideoBtn;
    UIButton                *_freeImageBtn;
    UIButton                *_playvideoBtn;
    UIButton                *_flowerBtn;
    BOOL _type;
    IMAUser *_imaUser;
    
@protected
    NSTimer                 *_inputStatusTimer;
    BOOL                    _isInLoop;//每3秒执行一次，如果在3秒之内，则不发送输入状态
    
@protected
    __weak id<XLChatInputToolBarUserDelegate> _toolBarDelegate;
}

@property (nonatomic, weak) id<XLChatInputToolBarUserDelegate> toolBarDelegate;
@property (nonnull,strong) UITextView *textView;

@property (nonatomic, assign) BOOL  isAnchor;

- (BOOL)isEditing;
- (instancetype)initWithChatType:(BOOL)type user:(IMAUser *)user;
- (instancetype)initWithchatType:(BOOL)type;
- (void)setInputText:(NSString *)text;
@property (nonnull,strong) NSMutableArray *btnArr;
@end


// 因表情在各端不统一
// ChatInputToolBar 中的表情是unicode编码，但在各平台台不能解析
// 为统一表情，各端统一使用表情图片代替原unicode字符串
@interface RichChatInputToolBarUser : XLChatInputToolBarUser

- (IMAMsg *)getMsgDraft;

- (void)setMsgDraft:(IMAMsg *)draft;

@end

